function getProperty<T, K extends keyof T>(o: T, name: K): T[K] {
    return o[name];
}

interface Person {
    name: string;
    age: number;
    job?: string[];
}

var ironman: Person = {
    name: 'Tony Stark',
    age: 42,
    job: ['CEO', 'CTO'],
};
var theName = getProperty(ironman, 'name');
console.log(theName.toUpperCase());

type Arrayish = {
    [n: number]: unknown;
};

type A = keyof Arrayish;

type Mapish = {
    [k: string]: boolean;
};

type M = keyof Mapish;
